export function getUrlParam (name, url) {
    //构造一个含有目标参数的正则表达式对象
    let reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)")
    let r;
    if (url) {
        r = url.substr(url.indexOf("?"));
    } else {
        r = window.location.search;
    }
    //匹配目标参数
    r = r.substr(1).match(reg);
    //返回参数值
    if (r != null){
        return decodeURI(r[2])
    }
    return null;
}